#include "../include/MultigridTwoDim.hpp"
#include "../include/json.hpp"
#include <iostream>
#include <fstream>

using json = nlohmann::json;
using namespace std;

int main()
{
    ifstream file("../src/json/input.json");
    if (!file.is_open())
    {
        cerr << "Failed to open file" << endl;
        return 1;
    }
    json j;
    file >> j;
    file.close();
    MultigridTwoDim M;
    M.Possion_BVP_Multigrid(j["size"], j["MultigridMethod"], 2.0 / 3, j["nu1"], j["nu2"],
                            j["BoundaryType"],
                            j["Restriction"],
                            j["Interpolation"], j["maxiteration"], 1e-8);
    M.display();                
    return 0;
}